package com.training.java.core.inheritance;


	public class Car {

		private int vinNumber;
		private String make;
		private String model;
		private String color;
		private int maxSpeed;
		private int currentSpeed;
		private int gear = 1;
		private boolean started;
		private int year;
		private int milesPerHour;

		// Constructor Car
		
	

		Car ()
		
		{
			
		}
		

		public Car(int vinNumber, String make, String model, String color, int maxSpeed,int milesPerHour,
				int year)
		{

			this.vinNumber = vinNumber;
			this.make = make;
			this.model = model;
			this.color = color;
			this.maxSpeed = maxSpeed;
			this.year = year;
			this. milesPerHour = milesPerHour;
		}

		
		
		
		// Start Method() to know the car status

		boolean start() {
			//System.out.println("car has started true/false: " + started);

			if (started == false) {
				System.out.println("car has started : " + started);
				started = true;

			}
			return started;
		}


		void  stop()
		
		{
			System.out.println("car has started true/false:");

		}

		
		
		
		
		//Drive Method 
		
		
		int drive()
		{
			
			System.out.println("i'm driving  with the speed"+ milesPerHour);
			return milesPerHour;
		}
		
		
		
		// accelerate speed method
		    int accelerateSpeed(int howmuch) {
		    	
			int wishFulCurrentSpeed = currentSpeed + howmuch;

			if (wishFulCurrentSpeed > 150) {
				  
				System.out.println("Max speed is "+ maxSpeed + " You can't go beyond that");
				  currentSpeed = maxSpeed;
			} else {
				currentSpeed = wishFulCurrentSpeed;
			}
			return currentSpeed;
		}

		// method to change color
		   

		String changeColor() {

			if (color == "Red") {
				color = "Black";
			}
			return color;
		}

		// Get the information for the variables

		public int getVinNumber() {
			return vinNumber;
		}

		public String getMake() {
			return make;
		}

		public String getModel() {
			return model;
		}

		public int getGear() {
			return gear;
		}

		public void setGear(int gear) {
			this.gear = gear;
		}

		public boolean isStarted() {
			return started;
		}

		public void setStarted(boolean started) {
			this.started = started;
		}

		public int getMaxSpeed() {
			return maxSpeed;

		}

		public int getCurrentSpeed() {
			return currentSpeed;
		}

		public String getCarColor() {
			return color;
		}

		public void setCarColor(String color) {
			this.color = color;
		}
		
		public int getMilesPerHour() {
			return milesPerHour;
		}


		public void setMilesPerHour(int milesPerHour) {
			this.milesPerHour = milesPerHour;
		}


	}



